package org.fastsyncer.parser.framework;

import java.util.concurrent.ConcurrentLinkedQueue;

import org.fastsyncer.common.entity.MappingTask;
import org.json.JSONObject;

public interface Parser {

	/**
	 * @param mappingTask
	 *            同步任务
	 * @param pos
	 *            开始位置/结束位置
	 * @param reasonQuene
	 *            错误记录队列
	 * @return Integer[]{ 总数total, 成功数success }
	 * @throws Exception
	 */
	public Integer[] parse(MappingTask mappingTask, Integer[] pos, ConcurrentLinkedQueue<JSONObject> reasonQuene) throws Exception;
	
	/**
	 * 
	 * @param mappingTask
	 *            同步任务
	 * @param row
	 *            增量数据
	 * @return 执行成功/失败
	 * @throws Exception
	 */
	public boolean parse(MappingTask mappingTask, JSONObject row) throws Exception;

}
